/*
 * To change this license header, choose License Headers in Project Properties.
 * To change this template file, choose Tools | Templates
 * and open the template in the editor.
 */
package report.committeeMembersAddressList;

import java.awt.Component;
import java.util.ArrayList;
import java.util.Arrays;
import java.util.List;
import report.rservice.SERReport;
import template.RegistrantionPanel;

/**
 *
 * @author User
 */
public class PCCommitteeMembersAddressList extends RegistrantionPanel {

    /**
     * Creates new form PCCommitteeMembersAddressList
     */
    public PCCommitteeMembersAddressList() {
        initComponents();
    }

    private Object[] getYears() {
        List list = SERReport.getYears();
        Object[] objects = list.toArray(new Object[list.size()]);
        return objects;
    }

    /**
     * This method is called from within the constructor to initialize the form.
     * WARNING: Do NOT modify this code. The content of this method is always
     * regenerated by the Form Editor.
     */
    @SuppressWarnings("unchecked")
    // <editor-fold defaultstate="collapsed" desc="Generated Code">//GEN-BEGIN:initComponents
    private void initComponents() {

        cboYear = new javax.swing.JComboBox(getYears());
        jLabel8 = new javax.swing.JLabel();

        setMinimumSize(new java.awt.Dimension(338, 83));

        jLabel8.setText("Year :");

        javax.swing.GroupLayout layout = new javax.swing.GroupLayout(this);
        this.setLayout(layout);
        layout.setHorizontalGroup(
            layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGroup(layout.createSequentialGroup()
                .addGap(36, 36, 36)
                .addComponent(jLabel8)
                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                .addComponent(cboYear, javax.swing.GroupLayout.PREFERRED_SIZE, 226, javax.swing.GroupLayout.PREFERRED_SIZE)
                .addContainerGap(43, Short.MAX_VALUE))
        );
        layout.setVerticalGroup(
            layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGroup(layout.createSequentialGroup()
                .addGap(31, 31, 31)
                .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
                    .addComponent(cboYear, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
                    .addComponent(jLabel8))
                .addContainerGap(32, Short.MAX_VALUE))
        );
    }// </editor-fold>//GEN-END:initComponents


    // Variables declaration - do not modify//GEN-BEGIN:variables
    private javax.swing.JComboBox cboYear;
    private javax.swing.JLabel jLabel8;
    // End of variables declaration//GEN-END:variables

    @Override
    public List<Component> getIdentityComponent() {
        return Arrays.asList(
                (Component) cboYear
        );
    }

    @Override
    public List<Component> getEsentialComponent() {
        return Arrays.asList();
    }

    @Override
    public List<Component> getOtherComponent() {
        return Arrays.asList();
    }

    @Override
    public Object initObject() {
        return cboYear.getSelectedItem();

    }

    @Override
    public void getUnbindObject(Object object) {
    }

    @Override
    public void bindComponents(ArrayList<Object> list, int index) {
    }

    @Override
    public List<Component> componentList() {
        return Arrays.asList(
                (Component) cboYear
        );
    }
}
